<template>
	<div class="layout layout-100">
		<Layout class="layout-100 modal">
			<Header class="header-cont">措施方案{{this.$route.params.name}}</Header>
			<Content class="content-cont  modal-content">
				<Tabs value="0" @on-click="">
					<TabPane label="风险信息" name="0">
						<Form label-position="top">
							<Row>
								<Col span="12">
								<FormItem label="公司名称">
									<Input style="width:350px;" v-model.trim="detailData.enterpriseName" :title="detailData.enterpriseName" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="所属区域">
									<Input style="width:350px;" v-model.trim="detailData.areaName"  readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="项目名称">
									<Input style="width:350px;" v-model.trim="detailData.projectName" :title="detailData.projectName" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="工点名称">
									<Input style="width:350px;" v-model.trim="detailData.constructionPointName" :title="detailData.constructionPointName" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="工点风险等级">
									<Input style="width:350px;" v-model.trim="detailData.distRiskGrade" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="起始时间">
									<Input style="width:350px;" v-model.trim="detailData.startTime" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="结束时间">
									<Input style="width:350px;" v-model.trim="detailData.endTime" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="是否在施">
									<Input style="width:350px;" v-model.trim="detailData.isWork" readonly />
								</FormItem>
								</Col>
								<Col span="24">
								<FormItem label="工点描述">
									<Input style="width:80%;" type="textarea" v-model.trim="detailData.constructionPointDescription" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="作业风险名称">
									<Input style="width:350px;" v-model.trim="detailData.riskName" :title="detailData.riskName" class="width50" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="作业风险类型">
									<Input style="width:350px;" v-model.trim="detailData.riskCategoryNames" :title="detailData.riskCategoryNames" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="作业风险等级">
									<Input style="width:350px;" v-model.trim="detailData.riskLevelName" :title="detailData.riskLevelName" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="分级方法">
									<Input style="width:350px;" v-model.trim="detailData.classificationMethodName" :title="detailData.classificationMethodName" readonly />
								</FormItem>
								</Col>
								<Col span="24">
								<FormItem label="具体风险描述">
									<Input style="width:80%;" type="textarea" v-model.trim="detailData.riskDescription" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="是否销号">
									<Input style="width:350px;" v-model.trim="detailData.isDestroy" readonly />
								</FormItem>
								</Col>
							</Row>
						</Form>
					</TabPane>
					<TabPane label="管控措施" name="1">
						<Form label-position="top">
							<Row>
								<Col span="12">
								<FormItem label="管控措施">
									<Input style="width:350px;" v-model.trim="measuresData.measures" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="频次">
									<Input style="width:350px;" v-model.trim="measuresData.frequencyName" readonly />
								</FormItem>
								</Col>
								<Col span="12">
								<FormItem label="措施类型">
									<Input style="width:350px;" v-model.trim="measuresData.measureType" readonly />
								</FormItem>
								</Col>
								<Col span="24">
								<FormItem label="动态管控岗">
									<Table border :columns="columns" :data="tableData">
									</Table>
								</FormItem>
								</Col>
							</Row>
						</Form>
					</TabPane>
				</Tabs>
			</Content>
		</Layout>
	</div>
</template>

<script>
	import {
		mapMutations
	} from 'vuex'
	export default {
		name: "measures-ledger-detail",
		data() {
			return {
				detailData: '',
				measuresData: '',
				riskId: '',
				measuresId: '',
				tableData: [],
				columns: [{
						title: '项目部管控部门',
						key: 'projectManagementDepartment',
						align: 'center'
					},
					{
						title: '项目部分管领导',
						key: 'projectManagementLeader',
						align: 'center'
					},
					{
						title: '项目部主管领导',
						key: 'leaderInChargeOfProjectDepartment',
						align: 'center'
					},
					{
						title: '工程公司管控部门',
						key: 'controlDepartmentOfEngineeringCompany',
						align: 'center'
					},
					{
						title: '工程公司分管领导',
						key: 'leaderInChargeOfEngineeringCompany',
						align: 'center'
					},
					{
						title: '集团公司管控部门',
						key: 'groupCompanyControlDepartment',
						align: 'center'
					},
					{
						title: '集团公司分管领导',
						key: 'leaderInChargeOfGroupCompany',
						align: 'center'
					}
				],
			}
		},
		methods: {
			getMeasuresDetail() { //信息详情
				this.$api.ledgerQuery.getMeasuresDetail(this.measuresId).then(res => {
					if (res.code === 200) {
						this.measuresData = res.data;
						this.measuresData.measureType = this.measuresData.measureType == 1 ? "管理" : "技术";
						this.tableData = [res.data];
					} else {
						this.$Message.warning(res.message)
					}
				})
			},
			getRiskOrderDestroydetail() { //信息详情
				this.$api.riskElimination.getRiskOrderDestroydetail(this.riskId).then(res => {
					if (res.code === 200) {
						this.detailData = res.data;
					} else {
						this.$Message.warning(res.message)
					}
				})
			},
		},
		created() {
			this.riskId = this.$route.params.id.split("-")[1];
			this.measuresId = this.$route.params.id.split("-")[0];
		},
		mounted() {
			this.getRiskOrderDestroydetail();
			this.getMeasuresDetail();
		}
	};
</script>

<style scoped>
	.width50 {
		width: 40%;
	}
</style>
